package com.chainyoung.component_tmperson.ui.mvp.model;

import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.entity.WalletFinancing;
import com.chainyoung.component_tmperson.entity.WalletFinancingOwn;
import com.chainyoung.component_tmperson.ui.mvp.contract.WalletFinancingMangeContract;
import com.chainyoung.component_tmperson.ui.mvp.contract.WalletFinancingTradeContract;

import java.util.List;
import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

public class WalletFinancingTradeModel extends BaseModel implements WalletFinancingTradeContract.Model {




    @Inject
    WalletFinancingTradeModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }






    @Override
    public Flowable<WalletFinancingOwn> getUserFinancingProfit(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .getUserFinancingProfit(map)
                .compose(RxUtils.<WalletFinancingOwn>handleResult());
    }

    @Override
    public Flowable<String> turnIn(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .turnIn(map)
                .compose(RxUtils.<String>handleResult());
    }
}

